<?php
namespace app\api\controller;

use app\api\model\TakeoutModel;
use think\Controller;
use think\Request;
use think\Db;

class Takeout extends Controller
{
   /**
    * 提现记录类
    *
    * 提交
    */
    public function MoneySubmit(Request $request){
        $data = $request->post();
        if(empty($data['name'])) $this->outPut('', 1001, ":缺少参数name" );
        if(empty($data['alipay'])) $this->outPut('', 1001, ":缺少参数alipay" );
        if(empty($data['money'])) $this->outPut('', 1001, ":缺少参数money" );
        if(empty($data['bid'])) $this->outPut('', 1001, ":缺少参数bid" );
        if($data['money'] < 500) $this->outPut(null,0);;
        list($result,$info) = TakeoutModel::instance()->MoneySubmit($data,$this->uid);
        if($result == false)  $this->outPut(null,$info);
        $this->jsonOut($info);
    }
    /**
     * 提现记录
     */
    public function Moneyrecord(Request $request){
        $bid = $request->get('bid');
        if(empty($bid)) $this->outPut('', 1001, ":缺少参数bid" );
        $result = TakeoutModel::instance()->Moneyrecord($this->uid,$bid);
        $this->jsonOut($result);
    }

}